<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>management</title>
<meta name="Keywords" content="" /> 
<meta name="Description" content="" />
<link type="text/css" rel="stylesheet" href="/css/management.css" />
<script src="/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="wrapper">
	<div class="mod_box">
		<div class="hd"><span class="tl"></span><span class="tr"></span></div>
		<div class="bd">
			<!--面包屑 begin-->
			<div class="crumb">location：<a href="javascript:void(0);">supervisor</a> &gt; add supervisor</div>
			<!--面包屑 end-->
			<!--表单 begin-->
			<form action="/index.php?r=supervisor/save" method="post" id="mainform">
				<input type="hidden" name="sid" value="{{$pageArray.row.id}}"/>
			<table class="mod_table">
				<tbody>
					<tr>
						<th><i class="must">*</i>Longin name：</th>
						<td>
							<input type="text" class="ipt_text" name="loginname" max="50" value="{{$pageArray.row.loginname}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Password：</th>
						<td>
							<input type="password" class="ipt_text" name="password" value="{{$pageArray.row.password}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>First Name：</th>
						<td>
							<input type="text" class="ipt_text" name="first_name" max="50" value="{{$pageArray.row.first_name}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Last Name：</th>
						<td>
							<input type="text" class="ipt_text" name="last_name" max="50" value="{{$pageArray.row.last_name}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Department：</th>
						<td>
							<input type="text" class="ipt_text" name="department" max="50" value="{{$pageArray.row.department}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Job Title：</th>
						<td>
								<input type="text" class="ipt_text" name="job_title" max="50" value="{{$pageArray.row.job_title}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Office Phone：</th>
						<td>
							<input type="text" class="ipt_text" name="office_phone1" max="3" value="{{$pageArray.row.office_phone1}}"/>
							—
							<input type="text" class="ipt_text" name="office_phone2" max="7" value="{{$pageArray.row.office_phone2}}"/>
							<input type="hidden" name="office_phone" value="{{$pageArray.row.office_phone}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Cell Phone：</th>
						<td>
							<input type="text" class="ipt_text" name="cell_phone1" max="3" value="{{$pageArray.row.cell_phone1}}"/>
							—
							<input type="text" class="ipt_text" name="cell_phone2" max="7" value="{{$pageArray.row.cell_phone2}}"/>
							<input type="hidden" name="cell_phone" value="{{$pageArray.row.cell_phone}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Emaill Address：</th>
						<td>
							<input type="text" class="ipt_text" name="email1" value="{{$pageArray.row.email1}}"/>
							@
							<input type="text" class="ipt_text" name="email2" value="{{$pageArray.row.email2}}"/>
							<input type="hidden" name="email" value="{{$pageArray.row.email}}"/>
						</td>
					</tr>
					<tr>
						<th><i class="must">*</i>Permission：</th>
						<td>
							{{html_checkboxes name="permission" checked=$pageArray.row.permission_checked options=$pageArray.permission separator="<br />"}}
						</td>
					</tr>
				</tbody>
			</table>
			</form>
			<!--表单 end-->
			<!--表格外提交区域 begin-->
			<div class="btn_tool">
				<a class="btn" href="javascript:void(0);" onclick="formSubmit();"><span>commit</span></a>
			</div>
			<!--表格外提交区域 end-->
		</div>
		<div class="ft"><span class="bl"></span><span class="br"></span></div>
	</div>
</div>
<script type="text/javascript">
	function formSubmit(){
		var commit = true;
		
		$(".mod_table").find("input[type='text']").each(function(){
			if($(this).val() == ""){
				alert("所有项都是必填！");
				commit = false;
				return false;
			}
		});
		
		if(commit){
			$("input[name='office_phone']").val($("input[name='office_phone1']").val() + '-' + $("input[name='office_phone2']").val());
			$("input[name='cell_phone']").val($("input[name='cell_phone1']").val() + '-' + $("input[name='cell_phone2']").val());
			$("input[name='email']").val($("input[name='email1']").val() + '@' + $("input[name='email2']").val());
			$("#mainform").submit();
		}
	}
</script>
</body>
</html>